home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / DefaultData.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-30  |  3.1 KB  |  93 lines

  1. package symantec.itools.db.awt;
  2.  
  3. import java.awt.Image;
  4.  
  5. public class DefaultData implements Data {
  6.    int row;
  7.    int col;
  8.    DataSource dataSource;
  9.  
  10.    public DefaultData(DataSource ds) {
  11.       this.dataSource = ds;
  12.    }
  13.  
  14.    public void setRowAndCol(int r, int c) {
  15.       this.row = r;
  16.       this.col = c;
  17.    }
  18.  
  19.    public int type() {
  20.       return this.dataSource.type(this.row, this.col);
  21.    }
  22.  
  23.    public boolean isEditable(int row, int col) {
  24.       return this.dataSource.isDataEditable(row, col);
  25.    }
  26.  
  27.    public boolean changed() {
  28.       return false;
  29.    }
  30.  
  31.    public void rollback() {
  32.    }
  33.  
  34.    public void commit() {
  35.    }
  36.  
  37.    public boolean isMasked() {
  38.       return this.dataSource.isMasked(this.row, this.col);
  39.    }
  40.  
  41.    public String getMask() throws TypeNotSupported {
  42.       return this.dataSource.getMask(this.row, this.col);
  43.    }
  44.  
  45.    public boolean supportsChoice() {
  46.       return this.dataSource.supportsChoice(this.row, this.col);
  47.    }
  48.  
  49.    public Data[] getChoices() throws TypeNotSupported {
  50.       return this.dataSource.getChoices(this.row, this.col);
  51.    }
  52.  
  53.    public void setText(String t) {
  54.       this.dataSource.setText(this.row, this.col, t);
  55.    }
  56.  
  57.    public void insertChar(int pos, char c) {
  58.       this.dataSource.insertChar(this.row, this.col, pos, c);
  59.    }
  60.  
  61.    public void setText(char c) {
  62.       this.setText(String.valueOf(c));
  63.    }
  64.  
  65.    public void appendChar(char c) {
  66.       this.dataSource.appendChar(this.row, this.col, c);
  67.    }
  68.  
  69.    public void clearText() {
  70.       this.dataSource.clearText(this.row, this.col);
  71.    }
  72.  
  73.    public void deleteChar(int pos) {
  74.       this.dataSource.deleteChar(this.row, this.col, pos);
  75.    }
  76.  
  77.    public String subString(int spos, int epos) {
  78.       return this.dataSource.subString(this.row, this.col, spos, epos);
  79.    }
  80.  
  81.    public void setImage(Image i) {
  82.       this.dataSource.setImage(this.row, this.col, i);
  83.    }
  84.  
  85.    public String toString() {
  86.       return this.dataSource.toString(this.row, this.col);
  87.    }
  88.  
  89.    public Image toImage() {
  90.       return this.dataSource.toImage(this.row, this.col);
  91.    }
  92. }
  93.